<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <include file="./Application/Home/View/Send/head.html" />
</head>
<body>
<!--菜单栏开始，小屏幕不可见-->
<div id="menu">
    <div class="col-sm-3 col-md-2 sidebar">
        <ul class="nav nav-sidebar">
            <li class="active"><a href="<{:U('Home/Send/basic')}>">基础信息</a></li>
            <li ><a href="<{:U('Home/Send/all')}>" >全局数据</a></li>
            <li><a href="<{:U('Home/Send/data')}>">资料管理</a></li>
            <li><a href="<{:U('Home/Send/verdict')}>">定案表管理</a></li>
        </ul>
    </div>
</div>
<!--菜单栏结束-->
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div style="float:right;">
                <div class="btn-group" role="group" aria-label="...">
                    <a type="button" href="/Public/Templete/basicTemplete.xlsx" target="_blank" class="btn btn-default">下载基础数据模板</a>
                    <form style="display:inline-block" action="<{:U('send/exportExcel')}>" method="POST" target="_blank">
                        <input type="hidden" name="type" value="basic" />
                        <button href="" class="btn btn-default">导出基础数据</button>
                    </form>
                    <label for="uploader-input" class="btn btn-default">导入基础数据</label>
                </div>
            </div>
            <h2 class="sub-header" style="display: inline-block; margin-top: 0">基础信息 <{$currentBatch}>
                <div class="btn-group" role="group">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        选择送审批次
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="<{:U('send/basic')}>">所有批次</a></li>
                        <volist name="batchList" id="batch">
                            <li><a href="<{:U('send/basic', ['batch' => $batch])}>"><{$batch}></a></li>
                        </volist>
                    </ul>
                </div>
                <!--div class="btn-group" role="group">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        选择送审专业
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="#">核对施工单位</a></li>
                        <li><a href="#">土建专业</a></li>
                        <li><a href="#">铁塔专业</a></li>
                        <li><a href="#">交流专业</a></li>
                        <li><a href="#">配套专业</a></li>
                    </ul>
                </div-->
            </h2>
            <div class="table table-responsive ">
                <table class="table table-striped table-bordered table-condensed">
                    <thead>
                    <tr>
                        <th><nobr>序号</nobr></th>
                        <th><nobr>项目批次</nobr></th>
                        <th><nobr>内验结束时间</nobr></th>
                        <th><nobr>批复金额</nobr></th>
                        <th><nobr>设计金额</nobr></th>
                        <th><nobr>所属区县</nobr></th>
                        <th><nobr>立项站名</nobr></th>
                        <th><nobr>项目编码</nobr></th>
                        <th><nobr>建设方式</nobr></th>
                        <th><nobr>分类</nobr></th>
                        <th><nobr>是否完工</nobr></th>
                        <th><nobr>备注</nobr></th>
                        <th><nobr>操作</nobr></th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="projects" id="project">
                        <tr>
                            <td><{$project.id}></td>
                            <td><{$project.batch}></td>
                            <td><{$project.inner_check_time}></td>
                            <td><{$project.amount_reply}></td>
                            <td><{$project.amount_design}></td>
                            <td><{$project.zone}></td>
                            <td><{$project.site_name}></td>
                            <td><{$project.project_code}></td>
                            <td><{$project.construction_type}></td>
                            <td><nobr><{$project.category}></nobr></td>
                            <td><{$project.is_complete}></td>
                            <td style="max-width:10em;white-space: nowrap; text-overflow: ellipsis; overflow: hidden;" title="<{$project.description}>"><{$project.description}></td>
                            <td>
                                <div style="width:80px" class="btn-group btn-group-xs" role="group" aria-label="...">
                                    <a style="float:left;" type="button" class="btn btn-default" href='<{:U("Home/Send/basemod",array("id"=>$project["id"]))}>'>修改</a>
                                    <button style="float:left;" type="button" class="btn btn-default delete" data-id="<{$project.id}>" data-type="baseinfo" data-url="<{:U('delete')}>">删除</button>
                                </div>
                            </td>
                        </tr>
                    </volist>

                    </tbody>
                </table>
            </div>
            <!--分页-->
            <nav>
                <ul class="pagination" id="page" >
                    <li><a href="<{$urls['basic']}>&amp;P=1&amp;batch=<{$currentBatch}>">首页</a></li>
                    <php>
                        for($i=1;$i<=$total;$i++){
                            echo '<li><a href="'.U('basic', ['P' => $i, 'batch' => $currentBatch]).'">'.$i.'</a></li>';
                        }
                    </php>
                    <li>
                        <a href="javascript:void(0);" aria-label="Next" onclick="more('<{$T}>','<{:U('basic', ['batch' => $currentBatch])}>')">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>


<include file="./Application/Home/View/Send/footJs.html" />
<script src="__PUBLIC__/public/JS/send.js"></script>
<script src="__PUBLIC__/static/js/ycom.js"></script>

<script>
$(function(){
    var uploader = Ycom.Uploader();
    uploader.init(function() {
        uploader.objs.input.change(function() {
            Ycom.loading.show();
            uploader.send();
        });
    }, function(r) {
        Ycom.loading.hide();
        if (r) {
            try {
                var result = $.parseJSON(r);
            } catch (e) {
                alert('导入失败！请检查数据格式并查看项目编号是否唯一');
                return;
            }
        }

        if (result.code == 'ok') {
            alert('成功导入 '+result.count+' 条数据');
            location.reload(true);
        } else {
            alert(result.msg);
        }
    }, {
        form: 'uploader-form',
        frame: 'uploader-frame',
        input: 'uploader-input',
        inputName: 'baseinfo',
        formAction: '<{:U("info/importBaseInfo")}>',
        fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
    });
});
</script>
</body>
</html>
